{extend name="layout/layout" /}

{block name="pagecss"}
<style>
    .user_jbzl_head{
        font-size: 16px;
        line-height: 25px;
    }
</style>
<link href="__STATIC__/admin/pages/css/order.css" rel="stylesheet" type="text/css" />
{/block}

{block name="content"}
<div class="row js-check-wrap">
    <div class="col-lg-12">
        <div class="box box-success">
            <div class="box-header with-border">
                <h3 class="box-title">售后订单详情</h3>
                <div class="box-tools pull-right">

                </div>
            </div>
            <div class="box-body">
                <!-- 基本资料 -->
                <div class="user_jbzl col-xs-12">
                    {if condition="$order.status == 1 "}
                    <h4 class="user_jbzl_head1">当前订单状态:等待买家付款</h4>
                    {elseif condition="$order.status == 2 "}
                    <h4 class="user_jbzl_head1">当前订单状态:等待卖家发货</h4>
                    {elseif condition="$order.status == 3 "}
                    <h4 class="user_jbzl_head1">当前订单状态:等待买家收货</h4>
                    {elseif condition="$order.status == 4 "}
                    <h4 class="user_jbzl_head1">当前订单状态:订单已完成</h4>
                    {elseif condition="$order.status == 9 "}
                    <h4 class="user_jbzl_head1">当前订单状态:拼团中</h4>
                    {elseif condition="$order.status == 6 "}
                    <h4 class="user_jbzl_head1">当前订单状态:售后中</h4>
                    {/if}
                    <!-- <h4 class="user_jbzl_head1" case="'5'">当前订单状态:订单失效</h4> -->
                    <!-- <h4 class="user_jbzl_head1" case="'6'">当前订单状态:订单正在做售后处理</h4> -->
                </div>

                <div class="user_jbzl col-xs-12 ">
                    <!-- 基本资料 -->
                    <div class="user_jbzl">
                        <div class="user_jbzl_head  ">订单信息</div>
                        <div style="height: 10px"></div>
                        <div class="row fpxx">
                            <div class="col-xs-6">店铺信息：{$tenantname}</div>
                            <div class="col-xs-6">订单编号：{$order.orderNO}</div>
                            <div class="col-xs-6">下单时间：<span id="jysj1">{$order.create_time}</span></div>
                            <div class="col-xs-6">
                                付款时间：<span id="jysj">{$order.payDate}</span>
                            </div>
                        </div>
                    </div>

                </div>

                <div class="col-xs-12" style="margin: 15px 0">
                    <!-- 基本资料 -->
                    <div class="user_jbzl">
                        <div class="user_jbzl_head  ">收货信息</div>
                        <div style="height: 10px"></div>
                        {if condition="$order['type'] == 0"}
                        <div class="row fpxx">
                            <div class="col-xs-6">收货人：{$order['userName']}</div>
                            <div class="col-xs-6">联系方式：{$order['userPhone']}</div>
                            <div class="col-xs-6">收货地址：{$order['deliverAddress']}</div>
                            <div class="col-xs-6">备注留言：{$order['content']}</div>
                        </div>
                        {elseif condition="$order['type'] == 1"/}
                            <div class="row fpxx">
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;到店自取订单<br/>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;取货店铺：{$tenantname}
                            </div>
                        {else /}
                        {/if}
                    </div>
                </div>
                <div class="col-xs-12 ">
                    <!-- 基本资料 -->
                    <div class="user_jbzl">
                        <div class="user_jbzl_head  ">售后原因</div>
                        <div style="height: 10px"></div>

                        <div class="row fpxx" style="padding-left: 17px">
                           {$Refundorder['reason']}
                        </div>

                    </div>
                </div>
                {empty name="refundImg"}
                {else /}
                <div class="col-xs-12 ">
                    <!-- 基本资料 -->
                    <div class="user_jbzl">
                        <div class="user_jbzl_head  ">售后凭证</div>
                        <div style="height: 10px"></div>

                        <div class="row fpxx" id="layimg_click" style="padding-left: 17px">
                            {volist name="refundImg" id='vo'}
                            <img width="100" class="small_img" style="margin-right: 10px;" src="/public/upload/{$vo}">
                            {/volist}
                        </div>

                    </div>
                </div>
                {/empty}

                <div class="col-xs-12 user_shdz">
                    <div style="height: 10px"></div>
                    <div class="user_jbzl_head">售后商品信息</div>
                    <div id="table" class="row" style="margin-top: 15px">
                        <div class="col-xs-12">
                            <table class="table table-bordered">
                                <tbody>
                                <tr>
                                    <th width="40%">商品</th>
                                    <th width="20%">单价</th>
                                    <th width="20%">数量</th>
                                    <th width="20%">商品总价</th>
                                </tr>
                                <tr>
                                    <td style="display: flex; align-items: center;border: none;justify-content: center;">
                                        <img src="{$Refundorder.order.RefundorderproductDetail.productImg}" width="71px" class=" margin-right-10" />
                                        <div class="pro_de">
                                            {$Refundorder.order.RefundorderproductDetail.productName}<br/>
                                            <span style="color:#999999">{$Refundorder.order.RefundorderproductDetail.productSpec} {$Refundorder.order.RefundorderproductDetail.productSpec1?$Refundorder.order.RefundorderproductDetail.productSpec1:''} {$Refundorder.order.RefundorderproductDetail.productSpec2?$Refundorder.order.RefundorderproductDetail.productSpec2:''}  </span>
                                        </div>
                                    </td>
                                    <td>
                                        {$Refundorder.order.RefundorderproductDetail.price/100}元
                                    </td>
                                    <td>
                                        {$Refundorder.order.RefundorderproductDetail.count}
                                    </td>
                                    <td>
                                        {$Refundorder.order.RefundorderproductDetail.price/100 * $Refundorder.order.RefundorderproductDetail.count}元
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>

                <div class="col-xs-12 " style="text-align: center">
                    <div  class="  o_total" style="margin-right: 15px">
                        优惠金额：&nbsp;0元
                    </div>
                    <div class="  o_total">
                        订单总金额：&nbsp;{$order.total / 100}元
                    </div>
                </div>
                <div class="col-xs-1" style="height: 30px;"></div>

                {if condition="$Refundorder.status == 4"}

                <form id="refund">
                    <input type="hidden" name="orderNO" value="{$Refundorder.orderNO}" />
                    <input type="hidden" name="productId" value="{$Refundorder.productId}" />
                    <input type="hidden" name="order_price" value="{$Refundorder.refund_fee}" />
                    <!-- 手机 -->
                    <div class="row user_form_g">
                        <div class="col-xs-2 text-right w_b_box">
                            <div style="padding: 6px 12px;">
                            <span class="txt_red">*</span> <span class="txt_no">售后处理：</span>
                            </div>
                        </div>
                        <div class="col-xs-3">
                            <div style="padding: 6px 12px;">
                                <input type="radio" checked="checked" onclick="getDeliver(this)" value="1" name="actiontype">同意&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <input type="radio" onclick="getDeliver(this)" value="0" name="actiontype">拒绝
                            </div>
                        </div>
                    </div>
                    <!-- 手机 -->
                    <div class="row user_form_g deliverwl" style="display: none">
                        <div class="col-xs-2 text-right w_b_box">
                            <span class="txt_red">*</span> <span class="txt_no">拒绝原因：</span>
                        </div>
                        <div class="col-xs-4">
                            <input class="form-control " type="text" name="content" maxlength="50" />
                        </div>
                    </div>
                    <!-- 手机 -->
                    <div class="row user_form_g deliverps" style="margin-left: 20%">
                        <div class="col-xs-3">
                            <div style="padding: 6px 12px;">
                                <input type="radio" checked="checked" onclick="getDeliverw(this)" value="1" name="fefund_isall">退还全部&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <input type="radio" onclick="getDeliverw(this)" value="0" name="fefund_isall">协商退款
                            </div>
                            <div class="row user_form_g deliverpsw" style="display: none">
                                <div class="col-xs-2" style="width: 200px;margin-left: 4%;">
                                    <input class="form-control " type="text" name="refund_fee" placeholder="退款金额" maxlength="25" />
                                </div>
                            </div>
                        </div>

                    </div>

                    <br />
                    <div class="row user_form_g">
                        <div class="col-xs-2 text-right w_b_box"></div>
                        <div class="col-xs-3 ">
                            <button type="button" id="yesOrder" class="btn btn-info"><i class="glyphicon glyphicon-ok"></i> 确定</button>
                            &nbsp;&nbsp;&nbsp;
                            <button type="button" id="return_add1" class="btn btn-default">取消</button>
                        </div>
                        <div class="col-md-5">
                            <span id="user_eidt_error" class="help-block text-left"></span>
                        </div>
                    </div>
                </form>
                {/if}

                {if condition="$Refundorder.status == 2"}
                <div class="col-xs-1" style="height: 60px;"></div>
                <div class="user_jbzl col-xs-12">
                    <div class="row user_form_g">
                        <div class="col-xs-2 text-right w_b_box">
                            <div style="padding: 6px 12px;">
                            <span class="txt_red">*</span> <span class="txt_no">处理结果：</span>
                            </div>
                        </div>
                        <div class="col-xs-3 fpxx">
                            <div style="padding: 6px 12px;">
                                已经退货或退款，售后完成
                            </div>
                        </div>
                    </div>
                </div>
                {/if}
                {if condition="$Refundorder.status == 1"}
                <div class="col-xs-1" style="height: 60px;"></div>
                <div class="user_jbzl col-xs-12">
                    <div class="row user_form_g">
                        <div class="col-xs-2 text-right w_b_box">
                            <div style="padding: 6px 12px;">
                                <span class="txt_red">*</span> <span class="txt_no">处理结果：</span>
                            </div>
                        </div>
                        <div class="col-xs-3 fpxx">
                            <div style="padding: 6px 12px;">
                                已经拒绝售后<br/>
                                原因：{$Refundorder.content}
                            </div>
                        </div>
                    </div>
                </div>
                {/if}
            </div>
        </div>
    </div>
</div>

{/block}

{block name="pagescript"}
<script>
    var DelivergoodsUrl = '/admin/Order/DoDelivergoods';
</script>
<script src="__STATIC__/admin/js/include.js" type="text/javascript"></script>
<script src="__STATIC__/admin/pages/js/order.js" type="text/javascript"></script>
<script>
    $(function(){
        $(".small_img").click(function(){
            layer.photos({
                photos: '#layimg_click'
                ,anim: 0 //0-6的选择，指定弹出图片动画类型，默认随机（请注意，3.0之前的版本用shift参数）
            });
        });
    });
</script>
{/block}